swagger2:
  enable: true
  base-package: ${package.Controller}
server:
  port: 8080
cors:
  enable: true
log:
  level: debug

db:
  host: ${cfg.dbIp}
  port: ${cfg.dbPort}
  username: ${cfg.dbUsername}
  password: ${cfg.dbPwd}
  database: ${cfg.dbDatabase}

logging:
  level:
    ${package.Mapper}: ${r"${"}log.level${r"}"}

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
  datasource:
<#if cfg.dbType == "mysql">
    url: jdbc:mysql://${r"${"}db.host${r"}"}:${r"${"}db.port${r"}"}/${r"${"}db.database${r"}"}?useUnicode=true&characterEncoding=UTF-8&createDatabaseIfNotExist=true&autoReconnect=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true
<#elseif cfg.dbType == "postgresql">
    url: jdbc:postgresql://${r"${"}db.host${r"}"}:${r"${"}db.port${r"}"}/${r"${"}db.database${r"}"}
<#elseif cfg.dbType == "sqlserver">
    url: jdbc:sqlserver://${r"${"}db.host${r"}"}:${r"${"}db.port${r"}"};;databasename=${r"${"}db.database${r"}"}
<#elseif cfg.dbType == "oracle">
    url: jdbc:oracle:thin:@${r"${"}db.host${r"}"}:${r"${"}db.port${r"}"}:ORCL
<#elseif cfg.dbType == "sqlite">
    url: jdbc:sqlite:${cfg.sqliteFileUrl}
</#if>
    driver-class-name: ${cfg.dbDriverName}
    username: ${r"${"}db.username${r"}"}
    password: ${r"${"}db.password${r"}"}
    hikari:
        pool-name: db-pool
        minimum-idle: 5
        maximum-pool-size: 50
        auto-commit: true
        idle-timeout: 30000
        <#if cfg.dbType == "mysql">
        connection-test-query: SELECT 1
        <#elseif cfg.dbType == "postgresql">
        connection-test-query: SELECT 1
        <#elseif cfg.dbType == "sqlserver">
        connection-test-query: SELECT 1
        <#elseif cfg.dbType == "oracle">
        connection-test-query: SELECT 1 FROM dual
        <#elseif cfg.dbType == "sqlite">
        connection-test-query: SELECT 1
        </#if>
        connection-timeout: 20000
        max-lifetime: 1800000


mybatis-plus:
  mapper-locations: classpath:config/mybatis/mapper/**/*-mapper.xml
  type-aliases-package: ${package.Entity}
  configuration:
    map-underscore-to-camel-case: true
    cache-enabled: false

<#--pagehelper:-->
<#--<#if cfg.dbType == "mysql">-->
<#--  helper-dialect: mysql-->
<#--  params: pageNum=number;pageSize=size-->
<#--<#elseif cfg.dbType == "postgresql">-->
<#--  helper-dialect: postgresql-->
<#--  params: count=countSql-->
<#--<#elseif cfg.dbType == "sqlserver">-->
<#--  helper-dialect: sqlserver-->
<#--  params: count=countSql-->
<#--</#if>-->
<#--  reasonable: true-->
<#--  pageSizeZero: true-->
<#--  support-methods-arguments: true-->
